package com.tomecode.rvr.generator;

import java.io.File;

/**
 * Configuration for report generator
 * 
 * @author Frastia Tomas
 * 
 * @parameter
 */
public final class Config {

	/**
	 * Directory which contais svn files and this directory will be generated
	 * report
	 * 
	 * @parameter default-value="${basedir}"
	 */
	private File workingDir;

	/**
	 * 
	 * File to which will be genereted report
	 * 
	 * 
	 * @parameter default-value="${basedir}"
	 */
	private File reportFile;
	/**
	 * if <b>true</b> then the report will contain data synchronized with svn
	 * 
	 * @parameter property="onlyWorking"
	 */
	private boolean onlyLocale;

	/**
	 * reprort type
	 * 
	 * @parameter property="reportType"
	 */
	private String reportType;
	/**
	 * output report formate
	 */
	private ReportFormate reportFormate;
	/**
	 * files which will be ignored
	 * 
	 * @parameter
	 */
	private String[] ignoredFiles;
	/**
	 * dir which will be ignored
	 * 
	 * @parameter
	 */
	private String[] ignoredDirs;
	/**
	 * @parameter
	 */
	private String user;
	/**
	 * @parameter
	 */
	private String password;

	/**
	 * @parameter
	 */
	private InReport inReport;

	/**
	 * Construktor
	 */
	public Config() {
		this.ignoredFiles = new String[] {};
		this.ignoredDirs = new String[] {};
		this.inReport = new InReport();
	}

	/**
	 * get {@link #workingDir}
	 * 
	 * @return
	 */
	public final File getWorkingDir() {
		return workingDir;
	}

	/**
	 * set {@link #workingDir}
	 * 
	 * @param workingDir
	 */
	public final void setWorkingDir(File workingDir) {
		this.workingDir = workingDir;
	}

	/**
	 * get {@link #reportFile}
	 * 
	 * @return
	 */
	public final File getReportFile() {
		return reportFile;
	}

	/**
	 * set {@link #reportFile}
	 * 
	 * @param reportFile
	 */
	public final void setReportFile(File reportFile) {
		this.reportFile = reportFile;
	}

	/**
	 * get {@link #reportFormate}
	 * 
	 * @return
	 */
	public final ReportFormate getType() {
		return reportFormate;
	}

	/**
	 * get {@link #reportType}
	 * 
	 * @return
	 */
	public final String getReportType() {
		return reportType;
	}

	/**
	 * set {@link #reportType}
	 * 
	 * @param reportType
	 */
	public final void setReportType(String reportType) {
		this.reportType = reportType;
		this.reportFormate = ReportFormate.find(reportType);
	}

	/**
	 * get {@link #ignoredFiles}
	 * 
	 * @return
	 */
	public final String[] getIgnoredFiles() {
		return ignoredFiles;
	}

	/**
	 * set {@link #getIgnoredFiles()}
	 * 
	 * @param ignoredFiles
	 */
	public final void setIgnoredFiles(String[] ignoredFiles) {
		this.ignoredFiles = ignoredFiles;
		if (this.ignoredFiles == null) {
			this.ignoredFiles = new String[] {};
		}
	}

	/**
	 * get {@link #ignoredFiles}
	 * 
	 * @return
	 */
	public final String[] getIgnoredDirs() {
		return ignoredDirs;
	}

	/**
	 * set {@link #ignoredFiles}
	 * 
	 * @param ignoredDirs
	 */
	public final void setIgnoredDirs(String[] ignoredDirs) {
		this.ignoredDirs = ignoredDirs;
		if (this.ignoredDirs == null) {
			this.ignoredDirs = new String[] {};
		}
	}

	/**
	 * get {@link #onlyLocale}
	 * 
	 * @return
	 */
	public final boolean isOnlyLocale() {
		return onlyLocale;
	}

	/**
	 * set {@link #onlyLocale}
	 * 
	 * @param onlyLocale
	 */
	public final void setOnlyLocale(boolean onlyLocale) {
		this.onlyLocale = onlyLocale;
	}

	/**
	 * get {@link #user}
	 * 
	 * @return
	 */
	public final String getUser() {
		return user;
	}

	/**
	 * set {@link #user}
	 * 
	 * @param user
	 */
	public final void setUser(String user) {
		this.user = user;
	}

	/**
	 * get {@link #password}
	 * 
	 * @return
	 */
	public final String getPassword() {
		return password;
	}

	/**
	 * set {@link #password}
	 * 
	 * @param password
	 */
	public final void setPassword(String password) {
		this.password = password;
	}

	/**
	 * get {@link #inReport}
	 * 
	 * @return
	 */
	public final InReport getInReport() {
		return inReport;
	}

	/**
	 * set {@link #inReport}
	 * 
	 * @param inReport
	 */
	public final void setInReport(InReport inReport) {
		this.inReport = inReport;
	}

}
